local blaze  = require "blaze"
local app = require "app"
local game = require "club.threecard.sudoku"

local M = game.ui.activity()

M.store_watchers = {
}

function M:ctor()
    self.res = "club.threecard.sudoku/ui/main.b:Home"
    local MainMenu = require "club.threecard.sudoku.ui.main.MainMenu"
    self.main_menu = MainMenu.new()
end

function M:on_injected(bind)
    bind("button.click", self.exit_btn, self.on_exit)
    bind("shortcut.escape", self.exit_btn.gameObject, self.on_exit)
    bind("gameobject.element", self.main_menu_obj, self.main_menu)
end

function M:on_set_parent()
    self:super("on_set_parent")
    self.transform:Stretch()
end

function M:on_exit()
    game.audio.post("click")
    app.game.exit()
end

return M